//
//  YDOAAddFixedProVC.swift
//  YDOAProduct
//
//  Created by 占益民 on 2017/12/1.
//  Copyright © 2017年 Allen. All rights reserved.
//

import UIKit

class YDOAAddFixedProVC: UIViewController {

    @IBOutlet weak var zicanTypeTF: UITextField! //资产类型
    
    @IBOutlet weak var zicanNameTF: UITextField! //资产名称
    
    @IBOutlet weak var guigeTF: UITextField! //规格
    
    @IBOutlet weak var danweiTF: UITextField! //单位
    
    @IBOutlet weak var priceTf: UITextField! //原始价格
    
    @IBOutlet weak var mentTF: UITextField! //部门
    
    @IBOutlet weak var strogeTf: UITextField! //存放地点
    
    @IBOutlet weak var wageUserTf: UITextField! //领用人
    
    @IBOutlet weak var nowUserTf: UITextField! // 使用人
    
    @IBOutlet weak var statusTf: UITextField! //状态
    
    @IBOutlet weak var remarkTF: UITextField! //备注
    
    @IBOutlet weak var surebtn: UIButton!
    
    
    var type : Int! // 1  添加  2 修改
    override func viewDidLoad() {
        super.viewDidLoad()
        if type == 1{
             title = "添加固定资产分配"
             surebtn.setTitle("确 认 添 加", for: .normal)
        }else{
            title = "修改固定资产分配"
            surebtn.setTitle("确 认 修 改", for: .normal)
        }
        self.navigationController?.navigationBar.isHidden = false
        self.automaticallyAdjustsScrollViewInsets = false
        self.edgesForExtendedLayout = .init(rawValue: 0)
        
        // Do any additional setup after loading the view.
    }

    //确认点击
    @IBAction func sureBtnClick(_ sender: Any) {
        
        if type == 1{
            YMLog.log(item: "确认添加")
        }else{
             YMLog.log(item: "确认修改")
        }
        
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        view.endEditing(true)
    }

}
extension  YDOAAddFixedProVC : UITextFieldDelegate {
    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        textField.returnKeyType = .done
        textField.resignFirstResponder()
        return true
    }
}

